<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class TokenProcessor</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class TokenProcessor</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">TokenProcessor class</p>
<p class="description"><p>TokenProcessor is responsible for handling all token related functionality.  The methods in this class are synchronized to protect token processing from  multiple threads.  Servlet containers are allowed to return a different  HttpSession object for two threads accessing the same session so it is not  possible to synchronize on the session.</p></p>
	<ul class="tags">
				<li><span class="field">since:</span> Struts 1.1</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_mvc---util---TokenProcessor.php.html">/mvc/util/TokenProcessor.php</a> (line <span class="field">43</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																				
												<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#generateToken" title="details" class="method-name">generateToken</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#getInstance" title="details" class="method-name">getInstance</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#isTokenValid" title="details" class="method-name">isTokenValid</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>, [<span class="var-type">reset</span>&nbsp;<span class="var-name">$reset</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#resetToken" title="details" class="method-name">resetToken</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#saveToken" title="details" class="method-name">saveToken</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_generateToken" title="details" class="method-name">_generateToken</a>
											(<span class="var-type">id</span>&nbsp;<span class="var-name">$id</span>)
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="methodgenerateToken" id="generateToken"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">generateToken</span> (line <span class="line-number">159</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate a new transaction token, to be used for enforcing a single  request for a particular transaction.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			generateToken
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">request</span>
				<span class="var-name">$request</span><span class="var-description">: The request we are processing</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getInstance</span> (line <span class="line-number">61</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Retrieves the singleton instance of this class.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getInstance
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodisTokenValid" id="isTokenValid"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">isTokenValid</span> (line <span class="line-number">90</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return <div class="src-code"><ol><li><div class="src-line"><span class="src-id">true</span></div></li>
</ol></div> if there is a transaction token stored in the  user's current session, and the value submitted as a request parameter  with this action matches it.  Returns <div class="src-code"><ol><li><div class="src-line"><span class="src-id">false</span></div></li>
</ol></div></p>
<p class="description"><p><ul><li>No session associated with this request</li><li>No transaction
 token saved in the session</li><li>No transaction token included as a request parameter</li><li>The included transaction token value does not match the transaction
 token in the user's session</li></ul></p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			isTokenValid
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>, [<span class="var-type">reset</span>&nbsp;<span class="var-name">$reset</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">request</span>
				<span class="var-name">$request</span><span class="var-description">: The servlet request we are processing</span>			</li>
					<li>
				<span class="var-type">reset</span>
				<span class="var-name">$reset</span><span class="var-description">: Should we reset the token after checking it?</span>			</li>
				</ul>
		
			
	</div>
<a name="methodresetToken" id="resetToken"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">resetToken</span> (line <span class="line-number">129</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reset the saved transaction token in the user's session.  This  indicates that transactional token checking will not be needed on the  next request that is submitted.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			resetToken
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">request</span>
				<span class="var-name">$request</span><span class="var-description">: The servlet request we are processing</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsaveToken" id="saveToken"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">saveToken</span> (line <span class="line-number">145</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Save a new transaction token in the user's current session, creating a  new session if necessary.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			saveToken
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$request</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">request</span>
				<span class="var-name">$request</span><span class="var-description">: The servlet request we are processing</span>			</li>
				</ul>
		
			
	</div>
<a name="method_generateToken" id="_generateToken"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_generateToken</span> (line <span class="line-number">172</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate a new transaction token, to be used for enforcing a single  request for a particular transaction.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_generateToken
		</span>
					(<span class="var-type">id</span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">id</span>
				<span class="var-name">$id</span><span class="var-description">: a unique Identifier for the session or other context in which            this token is to be used.</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Fri, 08 Feb 2008 14:32:43 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
	</p>
	</div></body>
</html>